import java.util.Random;
import java.util.Scanner;

public class test1 {
    /*public static void main(String[] args) {
        int a=30;
        int b=40;
        *//*if (a<99){
            System.out.println("hello");
        }
        else{
            System.out.println("world");
        }*//*
     *//*if (a>99){
            System.out.println("hello");
        }else if (b<30)
        {
            System.out.println("world");
        }
        else{
            System.out.println("nonono");
        }*//*
    }*/
    /*ublic static void main(String[] args) {
        int num=10;
        if (num%2==0) {
            System.out.println("偶数");
        }
        else{
            System.out.println("奇数");
        }
    }*/
    /*public static void main(String[] args) {
        int num=-10;
        if (num>0){
            System.out.println("正数");
        }else{
            System.out.println("负数");
        }
    }*/

    /*public static void main(String[] args) {
        int year = 2024;
        if (year % 400 == 0) {
            System.out.println("是闰年");
        } else if (year % 4 == 0 && year % 100 != 0) {
            System.out.println("是闰年");
        } else {
            System.out.println("不是闰年");
        }
    }*/

    /*public static void main(String[] args) {
        int a=3;
        switch (a){
            case 0:
                System.out.println("0");
                //break;
            case 1:
                System.out.println("1");
                //break;
            case 2:
                System.out.println("2");
                //break;
            case 3:
                System.out.println("3");
                //break;
            case 4:
                System.out.println("4");
                //break;
            default:
                System.out.println("........");
                break;
        }
    }*/

    /*public static void main(String[] args) {
        String str = "2";
        switch (str) {
            case "0":
                System.out.println("0");
                //break;
            case "1":
                System.out.println("1");
                //break;
            case "2":
                System.out.println("2");
                //break;
            case "3":
                System.out.println("3");
                //break;
            case "4":
                System.out.println("4");
                //break;
            default:
                System.out.println("........");
                break;
        }
    }*/

    /*public static void main(String[] args) {
        int a=1;
        while (a<=10)
        {
            System.out.println(a);
            a++;
        }
    }*/

    /*public static void main(String[] args) {
        int n=1;
        int num=0;
        while(n<=100)
        {
            num+=n;
            n++;
        }
        System.out.println(num);
    }*/

    /*ublic static void main(String[] args) {
        int i=1;
        int num=1;
        while(i<=5)
        {
            num*=i;
            i++;
        }
        System.out.println(num);
    }*/
    //计算 1! + 2! + 3! + 4! + 5!
    /* public static void main(String[] args) {
     *//*int i=1;
        int num=0;
        while(i<=5) {
            int n=1;
            int a=1;
            while(a<=i){
                n*=a;
                a++;
            }
            num+=n;
            i++;
        }
        System.out.println(num);*//*

        int num = 1;
        int sum = 0;
// 外层循环负责求阶乘的和
        while (num <= 5) {
            int factorResult = 1;
            int tmp = 1;
// 里层循环负责完成求阶乘的细节.
            while (tmp <= num) {
                factorResult *= tmp;
                tmp++;
            }
            sum += factorResult;
            num++;
        }
        System.out.println("sum = " + sum);
    }*/

/*
    //计算 1! + 2! + 3! + 4! + 5!
    public static void main(String[] args) {
        int num = 0;
        int a = 1;
        while (a <= 5) {
            int tmp = 1;
            int n = 1;
            while (n <= a) {
                tmp *= n;
                n++;
            }
            num += tmp;
            a++;
        }
        System.out.println(num);
    }
*/

   /* public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入姓名：");
        String name = sc.nextLine();
        System.out.println(name);
        Scanner bb=new Scanner(System.in);
        System.out.println("输入年龄：");
        String age = bb.nextLine();
        System.out.println(age);*/
    //}

    /*public static void main(String[] args) {
        Random random = new Random();
        Scanner sc = new Scanner(System.in);
        int toGuess = random.nextInt(100);
        System.out.println("请输入数字：");
        while(true){
            int num = sc.nextInt();
            if (num<toGuess){
                System.out.println("猜小了");
            }else if(num>toGuess){
                System.out.println("猜大了");
            }else{
                System.out.println("猜对了:"+num);
            }
        }
    }*/

    /*public static void main(String[] args) {
        int num = 0;
        for (int i = 0; i <= 100; i++) {
            if ((i % 10 == 9) || (i / 10 == 9)) {
                num++;
            }
        }
        System.out.println(num);
    }*/

   /* public static void main(String[] args) {
        int a = 10;
        System.out.println(!a);
    }*/


    /*public static void main1(String[] args) {
        int a=123;
        int b=(123%10);
        int c=123/10;
        int d=c%10;
        int f=c/10%10;
        System.out.println(b);
        System.out.println(d);
        System.out.println(f);
    }

    public static void main(String[] args) {
        int a=123;
        while (a>0){
            System.out.println(a%10);
            a=a/10;
        }
    }*/


    /*public static void main(String[] args) {
        int a = 17;
        *//*if (a % 1 == a && a % a == 0) {
            System.out.printf("是");
        } else {
            System.out.println("不是");
        }*//*
        for (int i = 2; i < a; i++) {
            if (a % i == 0) {
                System.out.println("不是");
                break;
            } else {
                System.out.println("是");
                break;
            }
        }
    }*/
    //1+2+3+4+5+...+10
    /*public  static int func(int a)
    {
        if (a==1) {
            return 1;
        }
        return a+func(a-1);
    }

    public static void main(String[] args) {
        System.out.println(func(10));
    }*/

    /*public static int func(int n)//n=1729
    {
        if (n < 10) {
            return n;
        }
        return (n % 10) + func(n / 10);
    }

    public static void main(String[] args) {
        System.out.println(func(1729));
    }*/

    public static long func(long n)
    {
        if(n==1||n==2){
            return 1;
        }
        return func(n-1)+func(n-2);

    }

    public static void main(String[] args) {
        System.out.println(func(50l));
    }
}
